﻿using MCPlatform.Dxf.Entities;
using MCPlatform.Dxf.Interfaces;
using netDxf.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MCPlatform.Dxf.Factories
{
    public class Polyline2DPathEntityFactory : IPathEntityFactory
    {
        public PathEntityBase CreatePathEntity(EntityObject entity)
        {
            if (entity is Polyline2D)
            {
                return new Polyline2DPathEntity((Polyline2D)entity);
            }
            else
            {
                throw new ArgumentException("The entity is not an Polyline2D");
            }
        }

       
        public Type GetHandledType()
        {
            return typeof(Polyline2D);
        }
    }
}
